package com.huahua.api.entity.pojo;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.util.Date;

import com.huahua.api.entity.vo.novel.ApiBookContentVo;
import lombok.Data;

/**
 * @author LoveHuahua
 * @date 2021年09月08日 9:55
 * @description believe in yourself
 */
@Data
@TableName(value = "api_novel_book_content")
public class ApiNovelBookContent {
    /**
     * 文章id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 小说id
     */
    @TableField(value = "book_id")
    private Integer bookId;

    /**
     * 文章内容
     */
    @TableField(value = "content")
    private String content;

    /**
     * 文章完整地址
     */
    @TableField(value = "content_url")
    private String contentUrl;

    /**
     * 创建时间
     */
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 逻辑删除
     */
    @TableField(value = "remove_flag")
    @TableLogic
    private int removeFlag;

    /**
     * 文章标题
     */
    @TableField(value = "content_title")
    private String contentTitle;

    public static final String COL_ID = "id";

    public static final String COL_BOOK_ID = "book_id";

    public static final String COL_CONTENT = "content";

    public static final String COL_CONTENT_FLAG = "content_flag";

    public static final String COL_CONTENT_URL = "content_url";

    public static final String COL_CREATE_TIME = "create_time";

    public static final String COL_UPDATE_TIME = "update_time";

    public static final String COL_REMOVE_FLAG = "remove_flag";

    public static final String COL_CONTENT_TITILE = "content_titile";

    public ApiBookContentVo toApiBookContentVo(){
        return new ApiBookContentVo().convert(this);
    }
}